local nanxia = fk.CreateSkill{
  name = "lingling__nanxia",
  tags = { Skill.Limited },
}

Fk:loadTranslationTable{
  ["lingling__nanxia"] = "南下",
  [":lingling__nanxia"] = "限定技，出牌阶段，你可以减1点体力上限，然后获得四张不计入手牌上限的【杀】。",

  ["#lingling__nanxia"] = "南下：减1点体力上限，获得四张不计入手牌上限的【杀】",
  ["@@lingling__nanxia-inhand"] = "南下",

  ["$lingling__nanxia1"] = "四海期一统久矣，君上何不遂万民之大愿？",
  ["$lingling__nanxia2"] = "衰周既死，贼陈再覆，则宇内澄清也。",
}

nanxia:addEffect("active", {
  anim_type = "offensive",
  prompt = "#lingling__nanxia",
  card_num = 0,
  target_num = 0,
  card_filter = Util.FalseFunc,
  can_use = function(self, player)
    return player:usedSkillTimes(nanxia.name, Player.HistoryGame) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:changeMaxHp(player, -1)
    if player.dead then return end
    local cards = room:getCardsFromPileByRule("slash", 4, "allPiles")
    if #cards > 0 then
      room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonJustMove, nanxia.name, nil, true, player, "@@lingling__nanxia-inhand")
    end
  end,
})

nanxia:addEffect("maxcards", {
  exclude_from = function(self, player, card)
    return card:getMark("@@lingling__nanxia-inhand") > 0
  end,
})

return nanxia
